package com.poispace;

  

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang.StringUtils;

public class Test {
 public static void main(String[] args) {
	 StringUtils.isNumeric("0.1");
	 System.err.println(""+(char)(66+65));
 
	 Pattern pattern = Pattern.compile("([-\\+]?[1-9]([0-9]*)(\\.[0-9]+)?)|(^0$)");
        Matcher isNum = pattern.matcher("0.1");
        if (!isNum.matches()) {
         
        	System.err.println("数值格式");
        }
        
        if(StringUtils.isNumeric("2.1")){
        	System.err.println("55555555555555");
        }else{
        	System.err.println("11111111111111111");
        }

  FileOutputStream fop = null;
  File file;
  String content = "This is the text content";

  try {

   file = new File("c:/newfile.txt");
   fop = new FileOutputStream(file);

   // if file doesnt exists, then create it
   if (!file.exists()) {
    file.createNewFile();
   }

   // get the content in bytes
   byte[] contentInBytes = content.getBytes();

   fop.write(contentInBytes);
   fop.flush();
   fop.close();

   System.out.println("Done");

  } catch (IOException e) {
   e.printStackTrace();
  } finally {
   try {
    if (fop != null) {
     fop.close();
    }
   } catch (IOException e) {
    e.printStackTrace();
   }
  }
 }
}
